var currLink ;
$(function() {

	$(".links li").zclip({
		path : 'js/clipboard/ZeroClipboard.swf',
		copy : function() {
			return $(this).text();
		},
		beforeCopy : function(event) {
			currLink = $('a',this).attr("href");
		},
		afterCopy : function() {
			$(this).css('background','#8DFF71');
			$.jBox.tip("成功复制【"+$(this).text()+"】到粘贴板！<a target='_blank' href='"+currLink+"'>这里打开链接</a>","success",{top:'10%'});
		}
	});
	
	$("#btn_copyall").zclip({
		path : 'js/clipboard/ZeroClipboard.swf',
		copy : function() {
			var data = "";
			$(".links li").each(function(){
				data += $(this).text()+"\n";
			});
			return data;
		},
		afterCopy : function() {
			$.jBox.tip("复制成功！","success",{top:'10%'});
		}
	});

});

